// const initalState ={
//     num:1
// }

export const reducer = (state=0,action) => {
    console.log(state,action,'---')
    switch (action.type){
        case 'ADD':
            return {
                state:state + 1
            }
        case 'JIAN':
            return {
                state:state - 1
            }
        default:
        return state;
    }
}